#!/usr/bin/env python
# -*- coding: utf-8 -*-


import os
import sys

if len(sys.argv) <= 1:
    print 'Usage: pycheck file'
    sys.exit(-1)

file_ = sys.argv[1]

if not file_.endswith('.py'):
    print 'only accept *.py file'
    sys.exit(-1)

os.system("pyflakes %s" % file_)
os.system("pep8 %s" % file_)
